]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Fix negative height request in WellGrid
authorSiegfried-Angel Gevatter Pujals <rainct@ubuntu.com>
Sun, 9 Aug 2009 01:34:35 +0000 (03:34 +0200)
committerSiegfried-Angel Gevatter Pujals <rainct@ubuntu.com>
Sun, 9 Aug 2009 01:34:35 +0000 (03:34 +0200)
When WellGrid had no child it was doing a division by zero,
which screwed up the calculation for the height request and
having it ask for a negative number. This commit fixes this
by always requesting 0 in this case.

js/ui/appDisplay.js

index f9924046fa38022e28c982deff20daa6ba4e53a8..1558f71f781b65c7623d48fc135ecaa7954fa80d 100644 (file)
@@ -686,6 +686,8 @@ WellGrid.prototype = {
         let columnsNatural;
         let i;
         let children = this._getItemChildren();
+        if (children.length == 0)
+            return [0, WELL_DEFAULT_COLUMNS, 0, 0];
         let nColumns;
         if (children.length < WELL_DEFAULT_COLUMNS)
             nColumns = children.length;